<?php
namespace app\controllers;

use fastphp\base\Controller;
use app\models\User;

class UserController extends Controller
{
    public function index()
    {
        $this->render();
    }
    public function login()
    {
        if (User::isLogin()) {
            die(header('Location: /'));
        }
        $this->assign('title', '登录');
        $this->render();
    }
    public function register()
    {
    }
    public function logout()
    {
        session_destroy();
        header('Location: /');
    }
}